package vip.sweet.aop.request;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 田连印
 * @Date 2025/1/16 14:40
 * @Descripition 请求监听切面
 */
@Aspect
@Component
@Slf4j
public class RequestListenerAop {
    @Pointcut("execution(public * com.vip.*.modular.*.controller..*.*(..))")
    public void pointCut() {
    }
    @Around("pointCut()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        log.info("{}下的{}接口正在被请求",pjp.getSignature().getDeclaringTypeName(),pjp.getSignature().getName());
        Object proceed = pjp.proceed();
        log.info("接口请求完成");
        return  proceed;
    }

}
